/* Apple Style API Documentation */
#app {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--color-background);
    min-width: 1000px;
    color: var(--color-text);
    line-height: 1.5;
}

.loading::after {
    content: "加载中...";
    display: flex;
    position: absolute;
    width: 100%;
    height: 100%;
    font-size: 24px;
    font-weight: 300;
    text-align: center;
    justify-content: center;
    align-items: center;
    color: var(--color-text-light);
}

/* Header Styles */
.header {
    background-color: var(--color-background-header);
    color: var(--color-text-inverse);
    height: 64px;
    padding: 0 24px;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--color-border-dark);
}

.header h1 {
    margin: 0;
    padding: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--color-text-inverse);
}

.header h1 sup {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.8;
    margin-left: 8px;
    color: var(--color-text-inverse);
}

.highlight {
    background-color: var(--color-background-selected);
    color: var(--color-primary);
}

/* Navigation */
.nav {
    display: none;
    justify-content: space-around;
    padding: 10px 0;
    width: 100%;
    top: 60px;
    z-index: 999;
}

.nav a {
    color: var(--color-white);
    text-decoration: none;
    padding: 10px 20px;
}

.nav a:hover {
    background-color: var(--color-gray);
}

/* Sidebar Styles */
.sidebar {
    background-color: var(--color-background-sidebar);
    color: var(--color-text);
    padding: 24px 10px;
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    width: 360px;
    min-height: calc(100vh - 64px);
}

.sidebar .filter-box {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 20px;
    box-sizing: border-box;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background-color: var(--color-background-card);
    transition: all 0.2s ease;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar .filter-box:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.1);
}

.sidebar .menu {
    user-select: none;
}

.sidebar .menu .menu-title {
    font-weight: 1000;
}

.sidebar .menu ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar .menu ul li {
    margin-bottom: 4px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
}

.sidebar .menu ul li>span {
    font-weight: 500;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
    display: block;
    font-size: 15px;
    background-color: var(--color-gray-50);
}

.sidebar .menu ul li.active>span {
    background-color: var(--color-background-selected);
    border-color: var(--color-border-focus);
    color: var(--color-primary);
}

.sidebar .menu ul li>span:hover {
    background-color: var(--color-background-hover);
}

.sidebar .menu ul .submenu li {
    margin-top: 1px;
    margin-left: 0;
    margin-bottom: 1px;
    width: 95%;
}

.sidebar .menu ul .submenu li span {
    display: flex;
    align-items: center;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    background-color: transparent;
}

.sidebar .menu ul .submenu li.active>span {
    background-color: var(--color-background-selected);
    color: var(--color-primary);
}

.sidebar .menu ul .submenu li>span:hover {
    background-color: var(--color-background-hover);
}

.sidebar .menu ul .submenu li i,
.api-endpoint i {
    border-radius: var(--radius-sm);
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
    padding: 4px 8px;
    margin-right: 12px;
    height: 20px;
    justify-content: center;
    align-items: center;
    display: inline-flex;
    font-size: 11px;
    font-weight: 600;
    min-width: 48px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.sidebar .menu ul .submenu li.active i {
    background-color: var(--color-primary-active);
}

.sidebar .menu .hide {
    display: none;
}

/* Content Area */
.api-section {
    padding: 32px 18px;
    background-color: var(--color-background-card);
    margin: 24px 12px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.api-section h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--color-text-heading);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 12px;
}

.api-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 16px 0;
    color: var(--color-text-heading);
}

.api-endpoint h3 {
    margin: 0 0 16px 0;
}

.api-endpoint pre {
    background-color: var(--color-gray-50);
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.4;
    margin: 16px 0;
    overflow-x: auto;
}

.api-endpoint table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.api-endpoint table th,
.api-endpoint table td {
    border: 1px solid var(--color-border);
    padding: 12px 16px;
    font-size: 14px;
}

.api-endpoint table th {
    background-color: var(--color-gray-50);
    font-weight: 600;
    color: var(--color-text-heading);
}

.api-endpoint table td {
    background-color: var(--color-background-card);
}

/* Tab Styles */
.tabs {
    margin: 16px 0;
    border-bottom: 1px solid var(--color-border);
}

.tablink {
    background-color: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 12px 20px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tablink:hover {
    color: var(--color-text);
    background-color: var(--color-gray-50);
}

.tablink.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background-color: transparent;
}

.tabcontent {
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-background-card);
    margin-top: -1px;
}

/* Button Styles */
button {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* Dropdown Styles */
.dropdown-content {
    position: absolute;
    background-color: var(--color-background-card);
    border: 1px solid var(--color-border);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    z-index: 1000;
    overflow: hidden;
}

.dropdown-content a {
    color: var(--color-text);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.dropdown-content a:hover {
    background-color: var(--color-background-hover);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sidebar {
        width: 280px;
    }

    .api-section {
        margin: 16px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    #app {
        min-width: auto;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
    }

    .container.flex.row {
        flex-direction: column;
    }
}

.fade-text {
    font-size: 32px;
    font-weight: bold;
    /* 渐变背景：上面不透明，下面透明 */
    background: linear-gradient(to bottom, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
    -webkit-background-clip: text;
    /* 让背景裁剪到文字形状 */
    -webkit-text-fill-color: transparent;
    /* 让文字本身透明，显示背景 */
    max-height: 2em;
}
